package com.donquijote.proxy.service.impl;

import com.donquijote.proxy.service.OrderService;

/**
 * @author 421527548@qq.com
 * @version V1.0
 * @title
 * @description
 * @date 2022-11-26 10:27
 */
public class OrderServiceImplProxy implements OrderService {
    OrderService target;

    public OrderServiceImplProxy(OrderService target) {
        this.target = target;
    }

    @Override
    public void generate() {
        long start = System.currentTimeMillis();
        target.generate();
        System.out.println(System.currentTimeMillis() - start + "毫秒");
    }

    @Override
    public void detail() {
        long start = System.currentTimeMillis();
        target.detail();
        System.out.println(System.currentTimeMillis() - start + "毫秒");
    }

    @Override
    public void modify() {
        long start = System.currentTimeMillis();
        target.modify();
        System.out.println(System.currentTimeMillis() - start + "毫秒");
    }
}